
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>个人社保计算-网页版</title>
		<!-- 新 Bootstrap5 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css">
 
<!--  popper.min.js 用于弹窗、提示、下拉菜单 -->
<script src="https://cdn.staticfile.org/popper.js/2.9.3/umd/popper.min.js"></script>
 
<!-- 最新的 Bootstrap5 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.min.js"></script>
<script>
	function calc() {
		sal=document.getElementById("salary").value;
		salnum=parseInt(sal);
		ylgr01=salnum*0.08;
		ylgs01=salnum*0.2;
		document.getElementById("ylgr").innerText=ylgr01;
		document.getElementById("ylgs").innerText=ylgs01;
		ybgr01=salnum*0.02;
		ybgs01=salnum*0.06;
		document.getElementById("ybgr").innerText=ybgr01;
		document.getElementById("ybgs").innerText=ybgs01;
		sygr01=salnum*0.005;
		sygs01=salnum*0.015;
		document.getElementById("sygr").innerText=sygr01;
		document.getElementById("sygs").innerText=sygs01;	
        gsgs01=salnum*0.005;
		document.getElementById("gsgs").innerText=gsgs01;
	    syugs01=salnum*0.008;
		document.getElementById("syugs").innerText=syugs01;
		gjjgr01=salnum*0.12;
		gjjgs01=salnum*0.12;
		document.getElementById("gjjgr").innerText=gjjgr01;
		document.getElementById("gjjgs").innerText=gjjgs01;
		grhj01=ylgr01+ybgr01+sygr01+gjjgr01;
		gshj01=ylgs01+ybgs01+sygs01+gsgs01+syugs01+gjjgs01;
		document.getElementById("grhj").innerText=grhj01;
		document.getElementById("gshj").innerText=gshj01;
        total01=salnum+gshj01;
		document.getElementById("total").innerText=total01;	
	}
</script>
	</head>
	<body>
		<div class="container text-center">
			<h2>个人社保计算软件</h2>
			 <table class="table table-bordered text-center">
			 	<tr>
			 		<td>工资</td>
			 		<td colspan="3">
			 			<input  class="form-control"  id="salary" type="text" placeholder="请输入工资"/>
			 		</td>
			 		<td>
			 			<button onclick="calc()" class="btn btn-block btn-danger">计算<tton>
			 		</td>
			 	</tr>
			 	<tr class="bg-primary">
			 		<td>险种</td>
			 		<td>个人%</td>
			 		<td>个人</td>
			 		<td>公司%</td>
			 		<td>公司</td>
			 	</tr>
			 	<tr>
			 		<td class="bg-info">养老</td>
			 		<td>8%</td>
			 		<td id="ylgr"></td>
			 		<td>20%</td>
			 		<td id="ylgs"></td>
			 	</tr>
			 	<tr>
			 		<td class="bg-info">医保</td>
			 		<td>2%</td>
			 		<td id="ybgr"></td>
			 		<td>6%</td>
			 		<td id="ybgs"></td>
			 	</tr>
			 	<tr>
			 		<td class="bg-info">失业</td>
			 		<td>0.5%</td>
			 		<td id="sygr"></td>
			 		<td>1.5%</td>
			 		<td id="sygs"></td>
			 	</tr>
			 	<tr>
			 		<td class="bg-info">工伤</td>
			 		<td></td>
			 		<td></td>
			 		<td>0.5%</td>
			 		<td id="gsgs"></td>
			 	</tr>
			 		<tr>
			 		<td class="bg-info">生育</td>
			 		<td></td>
			 		<td></td>
			 		<td>0.8%</td>
			 		<td id="syugs"></td>
			 	</tr>		
			 	<tr>
			 		<td class="bg-info">公积金</td>
			 		<td>12%</td>
			 		<td id="gjjgr"></td>
			 		<td>12%</td>
			 		<td id="gjjgs"></td>
			 	</tr>
			 	<tr>
			 		<td class="bg-info">合计</td>
			 		<td>个人合计</td>
			 		<td id="grhj"></td>
			 		<td>公司合计</td>
			 		<td id="gshj"></td>
			 	</tr>
			 	<tr>
			 		<td class="bg-info">总额</td>
			 		<td colspan="4" id="total"></td>
			 	</tr>
			 </table>
			 开发者：李雪茹  太原学院计算机系
		</div>
	</body>
<html>

